package org.huzhp.model;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.huzhp.user.entity.BaseUser;
import org.springframework.beans.BeanUtils;

@Data
public class ApiUser {

    @ApiModelProperty(value = "用户id", name = "id", required = true)
    private Long id;

    @ApiModelProperty(value = "用户编码", name = "name", required = true)
    private String code;

    @ApiModelProperty(value = "用户名", name = "name", required = true)
    private String name;

    @ApiModelProperty(value = "密码", name = "password")
    private String password;

    public ApiUser(BaseUser user) {
        if (user == null) {
            return;
        }
        BeanUtils.copyProperties(user, this);
    }

}
